﻿<scc:Dialog x:Class="Supremacy.Client.SinglePlayerStartScreen"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:s="http://schemas.startreksupremacy.com/xaml/core"
            xmlns:scc="http://schemas.startreksupremacy.com/xaml/presentation"
            xmlns:local="clr-namespace:Supremacy.Client"
            HasBorder="False"
            IsModal="False">
  <scc:Dialog.Resources>
    <Style TargetType="{x:Type TabItem}"
           BasedOn="{StaticResource {x:Type TabItem}}">
      <Setter Property="Margin"
              Value="0,0,0,1" />
      <Setter Property="Header"
              Value="{Binding Path=ShortName, Converter={StaticResource UpperCaseConverter}}" />
    </Style>
    <DataTemplate x:Key="CivSelectorContentTemplate"
                  DataType="{x:Type s:Civilization}">
      <DockPanel LastChildFill="True"
                 TextBlock.FontSize="14"
                 TextBlock.Foreground="{StaticResource LCARS_ParagraphBrush}"
                 TextBlock.FontFamily="{StaticResource LCARS_ParagraphFont}">
        <Border DockPanel.Dock="Left"
                VerticalAlignment="Top"
                Margin="0,0,16,0"
                BorderBrush="White"
                BorderThickness="2"
                Width="160">
          <Image Source="{Binding Converter={StaticResource CivImageConverter}}" />
        </Border>
        <ScrollViewer CanContentScroll="False"
                      VerticalScrollBarVisibility="Auto">
          <StackPanel Orientation="Vertical">
            <TextBlock Text="{Binding Path=LongName, Converter={StaticResource UpperCaseConverter}}"
                       FontSize="22"
                       Foreground="{StaticResource LCARS_HeaderBrush}"
                       FontFamily="{StaticResource LCARS_DefaultFont}" />
            <ScrollViewer Margin="0,12,0,0"
                          VerticalScrollBarVisibility="Auto">
              <TextBlock FontSize="{DynamicResource {x:Static scc:ClientResources.DefaultFontSizeKey}}"
                         Text="{Binding Path=DiplomacyReport}"
                         TextWrapping="Wrap" />
            </ScrollViewer>
          </StackPanel>
        </ScrollViewer>
      </DockPanel>
    </DataTemplate>

    <Style TargetType="{x:Type TabControl}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type TabControl}">
            <Border>
              <ItemsPresenter />
            </Border>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="ItemsPanel">
        <Setter.Value>
          <ItemsPanelTemplate>
            <StackPanel Orientation="Vertical"
                        IsItemsHost="True" />
          </ItemsPanelTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="CivSelectorItemStyle"
           TargetType="{x:Type TabItem}">
      <Setter Property="Width"
              Value="140" />
      <Setter Property="ContentTemplate"
              Value="{StaticResource CivSelectorContentTemplate}" />
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type TabItem}">
            <DockPanel LastChildFill="True">
              <Rectangle x:Name="SelectionHiglight"
                         DockPanel.Dock="Left"
                         Opacity="0.25"
                         Fill="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                         Width="12" />
              <Image DockPanel.Dock="Left"
                     Height="28"
                     Width="28"
                     Stretch="Uniform"
                     Margin="3,0,3,0"
                     Source="{Binding Converter={StaticResource CivInsigniaConverter}}" />
              <ToggleButton Style="{DynamicResource LCARS_SimpleToggleButtonStyle}"
                            Padding="6,3,6,3"
                            FontSize="18"
                            HorizontalContentAlignment="Left"
                            FontFamily="{DynamicResource LCARS_DefaultFont}"
                            Content="{Binding Path=ShortName, Converter={StaticResource UpperCaseConverter}}"
                            IsChecked="{Binding Path=(Selector.IsSelected), Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
            </DockPanel>
            <ControlTemplate.Triggers>
              <Trigger Property="IsSelected"
                       Value="True">
                <Setter TargetName="SelectionHiglight"
                        Property="Opacity"
                        Value="1.0" />
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
          <!--<ControlTemplate TargetType="{x:Type ListBoxItem}">
            <DockPanel LastChildFill="False"
                       MaxWidth="225"
                       Margin="6,0,6,0">
              <Grid x:Name="ImageHost"
                    DockPanel.Dock="Top">
                <Border x:Name="ImageBorder"
                        CornerRadius="16"
                        BorderThickness="2"
                        BorderBrush="Silver"
                        Width="120"
                        Height="160">
                  <Border.Background>
                    <ImageBrush ImageSource="{Binding Converter={StaticResource CivImageConverter}}"
                                Stretch="UniformToFill" />
                  </Border.Background>
                </Border>
                <Image HorizontalAlignment="Left"
                       VerticalAlignment="Bottom"
                       Height="32"
                       Width="32"
                       Margin="8"
                       Source="{Binding Converter={StaticResource CivInsigniaConverter}}"
                       Stretch="Uniform">
		<UIElement.Effect>
			<DropShadowEffect ShadowDepth="0" BlurRadius="10.0" Color="Black" Opacity="1.0" />
		</UIElement.Effect>
                </Image>
              </Grid>
              <TextBlock DockPanel.Dock="Top"
                         FontFamily="{StaticResource LCARS_DefaultFont}"
                         FontSize="16pt"
                         Foreground="{StaticResource LCARS_HeaderBrush}"
                         Text="{Binding Path=LongName, Converter={StaticResource UpperCaseConverter}}"
                         HorizontalAlignment="Center"
                         Margin="6,12,6,0" />
              <TextBlock DockPanel.Dock="Top"
                         FontFamily="{StaticResource LCARS_ParagraphFont}"
                         FontSize="14"
                         Foreground="{StaticResource LCARS_ParagraphBrush}"
                         Text="{Binding Path=DiplomacyText}"
                         TextTrimming="WordEllipsis"
                         TextWrapping="Wrap"
                         Margin="0,12,0,0" />
            </DockPanel>
            <ControlTemplate.Triggers>
              <Trigger Property="IsSelected"
                       Value="True">
                <Setter TargetName="ImageBorder"
                        Property="Opacity"
                        Value="1.0" />
                <Setter TargetName="ImageBorder"
                        Property="BorderBrush"
                        Value="DodgerBlue" />
              </Trigger>
              <Trigger Property="IsMouseOver"
                       Value="True">
                <Setter TargetName="ImageBorder"
                        Property="BorderBrush"
                        Value="White" />
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>-->

        </Setter.Value>
      </Setter>
    </Style>
  </scc:Dialog.Resources>
  <Border CornerRadius="32"
          Background="#cc000000">
    <!--<Grid Width="1024"
          Height="768">
      <ListBox ItemsSource="{Binding}"
               ItemContainerStyle="{StaticResource EmpireListBoxItemStyle}"
               HorizontalAlignment="Stretch">
        <ListBox.ItemsPanel>
          <ItemsPanelTemplate>
            <WrapPanel Orientation="Horizontal"
                       IsItemsHost="True" />
          </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
      </ListBox>
    </Grid>-->
    <Grid Width="960"
          Height="640">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="140" />
        <ColumnDefinition Width="28" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <Path x:Name="UpperLeftCorner"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Grid.Row="0"
            Width="168"
            Height="40"
            Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
            Data="F1 M 0,40L 0,24C 0,17.6348 2.52857,11.5303 7.02944,7.02944C 11.5303,2.52857 17.6348,0 24,0L 168,0L 168,12.9737L 148,12.9737C 143.582,12.9737 140,16.5554 140,20.9737L 140,40L 0,40 Z" />
      <DockPanel Grid.Column="0"
                 Grid.Row="1"
                 Margin="0,1,0,0"
                 LastChildFill="True">
        <Border DockPanel.Dock="Top"
                Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                MinHeight="48">
          <TextBlock FontSize="14pt"
                     Foreground="Black"
                     VerticalAlignment="Bottom"
                     HorizontalAlignment="Left"
                     FontFamily="{StaticResource LCARS_DefaultFont}"
                     Text="{s:StringResource SINGLE_PLAYER_SETUP_SELECT_EMPIRE}"
                     Margin="6,3,6,3" />
        </Border>
        <TabControl x:Name="CivSelector"
                    DockPanel.Dock="Top"
                    Margin="0,2,0,0"
                    BorderThickness="0"
                    Background="Transparent"
                    ItemStringFormat=""
                    ItemsSource="{Binding}"
                    IsSynchronizedWithCurrentItem="True" />
        <Grid x:Name="UpperLeftSide"
              Margin="0,0,0,0">
          <Border Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                  BorderThickness="0"
                  Width="69"
                  Height="Auto"
                  HorizontalAlignment="Left" />
          <Border Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                  BorderThickness="0"
                  Width="69"
                  Height="Auto"
                  HorizontalAlignment="Right" />
        </Grid>
      </DockPanel>
      <Path x:Name="LowerUpperLeftCorner"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Grid.Row="2"
            Width="168"
            Height="40"
            Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
            Margin="0,2,0,0"
            Data="F1 M 0,0L 0,16C 0,22.3652 2.52857,28.4697 7.02944,32.9706C 11.5303,37.4714 17.6348,40 24,40L 168,40L 168,27.0263L 148,27.0263C 143.582,27.0263 140,23.4446 140,19.0263L 140,0L 0,0 Z" />
      <Rectangle Grid.Column="2"
                 Grid.Row="2"
                 Margin="2,0,2,0"
                 Height="13"
                 Fill="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                 VerticalAlignment="Bottom" />
      <Rectangle Grid.Column="2"
                 Grid.Row="0"
                 Margin="2,0,2,0"
                 Height="13"
                 Fill="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                 VerticalAlignment="Top" />
      <Path x:Name="UpperRightCorner"
            Grid.Column="3"
            Grid.Row="0"
            Margin="0,0,0,2"
            Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
            Data="F1 M -2.86102e-006,0L 3.8147e-006,9.33337C 3.8147e-006,15.5555 3.8147e-006,21.7777 3.11111,24.8888C 6.22223,28 12.4444,28 18.6667,28L 28,28L 28,18.6666L 18.6667,18.6666C 15.5556,18.6666 12.4444,18.6666 10.8889,17.1112C 9.33334,15.5555 9.33334,12.4445 9.33334,9.33337L 9.33334,0L -2.86102e-006,0 Z ">
        <Path.LayoutTransform>
          <ScaleTransform ScaleX="-1.25"
                          CenterX="16"
                          ScaleY="-1.42" />
        </Path.LayoutTransform>
      </Path>
      <Path x:Name="LowerRightCorner"
            Grid.Column="3"
            Grid.Row="2"
            Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
            Margin="0,2,0,0"
            Data="F1 M -2.86102e-006,0L 3.8147e-006,9.33337C 3.8147e-006,15.5555 3.8147e-006,21.7777 3.11111,24.8888C 6.22223,28 12.4444,28 18.6667,28L 28,28L 28,18.6666L 18.6667,18.6666C 15.5556,18.6666 12.4444,18.6666 10.8889,17.1112C 9.33334,15.5555 9.33334,12.4445 9.33334,9.33337L 9.33334,0L -2.86102e-006,0 Z ">
        <Path.LayoutTransform>
          <ScaleTransform ScaleX="-1.25"
                          CenterX="16"
                          ScaleY="1.42" />
        </Path.LayoutTransform>
      </Path>
      <Rectangle Grid.Column="3"
                 Grid.Row="1"
                 Width="12"
                 HorizontalAlignment="Right"
                 Fill="{StaticResource LCARS_BlueGradient_Left_Right}" />
      <DockPanel Grid.Row="1"
                 Grid.Column="2"
                 LastChildFill="True">
        <DockPanel DockPanel.Dock="Right"
                   MaxWidth="250">
          <local:GameOptionsPanel x:Name="OptionsPanel"
                                  DockPanel.Dock="Top" />
          <StackPanel DockPanel.Dock="Bottom"
                      Orientation="Horizontal"
                      Margin="0,14,0,0"
                      HorizontalAlignment="Center"
                      VerticalAlignment="Bottom">
            <Button x:Name="OkButton"
                    IsDefault="True"
                    Style="{StaticResource LCARS_SimpleButtonStyle}"
                    Click="OkButton_Click">
              <AccessText Text="{s:StringResource Key=MESSAGE_DIALOG_OK, Case=Upper}" />
            </Button>
            <Button x:Name="CancelButton"
                    IsCancel="True"
                    Margin="7,0,0,0"
                    Style="{StaticResource LCARS_SimpleButtonStyle}">
              <AccessText Text="{s:StringResource Key=MESSAGE_DIALOG_CANCEL, Case=Upper}" />
            </Button>
          </StackPanel>
        </DockPanel>
        <Rectangle DockPanel.Dock="Right"
                   Fill="{StaticResource LCARS_BlueGradient_Left_Right}"
                   Width="8"
                   Margin="16,0,16,0" />
        <ContentControl Content="{Binding ElementName=CivSelector, Path=SelectedContent}"
                        ContentTemplate="{StaticResource CivSelectorContentTemplate}" />
      </DockPanel>
    </Grid>
  </Border>
</scc:Dialog>